package com.example.fresh_fruit.mapper;

import com.example.fresh_fruit.dto.DeliveryDto;
import com.example.fresh_fruit.dto.OrderDto;
import com.example.fresh_fruit.entity.Orders;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author :飞天の鱼
 * @date : 2022/8/18 11:49
 */
@Repository
public interface OrdersMapper {

    List<Orders> selectAll();


    int insertOders(OrderDto orderDto);

    /**
     * @param orders
     * 检查要插入的订单数据是否合理
     * @return
     */
    int cheakOrders(Orders orders);

    List<String> selectOrderNo();

    /**
     * @param commodityNo
     * 根据订单的编号，查询订单
     * @return
     */
    Orders selectByNo(String commodityNo);

    int findMaxId();

    /**
     *插入送货表，在订单表中加入包的数量
     * */
    int insertDelivery(DeliveryDto deliveryDto);
}
